package com.lt.test.consumer.web.controller;//package com.lt.test.consumer.controller;
//
//import com.lt.test.api.ProcessService;
//import com.lt.test.common.util.WebUtils;
//import com.lt.test.entity.DTO.ResponseDTO;
//import net.sf.json.JSONObject;
//import org.activiti.engine.repository.Deployment;
//import org.activiti.engine.repository.ProcessDefinition;
//import org.activiti.engine.runtime.ProcessInstance;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.multipart.MultipartFile;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.xml.ws.Action;
//import java.io.InputStream;
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.zip.ZipInputStream;
//
///**
// * @author lt
// * @date 2018/11/20 16:45
// */
//@Controller
//@RequestMapping("/process")
//public class ProcessController {
//
//    @Reference(version = "1.0.0")
//    private ProcessService processService;
//
//    /**
//     * 页面跳转
//     * @return
//     */
//    @RequestMapping("/index")
//    public String index(){
//        return "content/process/index";
//    }
//
//    /**
//     * 部署流程引擎
//     */
//    @RequestMapping(value="/repository", produces="application/json;charset=UTF-8")
//    public @ResponseBody ResponseDTO
//    RepositoryService(HttpServletResponse response, HttpServletRequest request){
//        Map<String,Object> parameter = WebUtils.getAllParamMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        Deployment deployment = null; //流程定义相关的service
//        try {
//            Map<String,Object> parame = processService.getRepositoryService(parameter);
//            responseDTO.setMessage(parame.get("message").toString());
//            responseDTO.setSuccess(true);
//            responseDTO.setCode("000");
//        } catch (Exception e) {
//            responseDTO.setMessage("部署失败");
//            responseDTO.setSuccess(false);
//            responseDTO.setCode("500");
//        }
//        return responseDTO;
//    }
//
//    /**
//     *查询最新版本的流程定义
//     *
//     */
//    @RequestMapping(value = "/findlastVerion")
//    public @ResponseBody ResponseDTO findlastVerionProcessDefinition(HttpServletRequest request){
//        Map<String,Object> parameter = WebUtils.getAllParamMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        try {
//            List<Map<String, Object>> list =  processService.createProcessDefinitionQuery();
//            responseDTO.setCode("000");
//            responseDTO.setMessage("获取成功");
//            responseDTO.setSuccess(true);
//            responseDTO.setData(list);
//        } catch (Exception e) {
//            responseDTO.setCode("500");
//            responseDTO.setMessage("获取失败");
//            responseDTO.setSuccess(false);
//        }
//        return responseDTO;
//    }
//
//    /**
//     * 启动流程实例
//     */
//    @RequestMapping(value = "/start", produces="application/json;charset=UTF-8")
//    public @ResponseBody ResponseDTO startProcessEngine(HttpServletResponse response, HttpServletRequest request) {
//        Map<String,String> parameter = WebUtils.getAllParamMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        try {
//            processService.getRuntimeService(parameter); // 启动流程定义相关的service
//            responseDTO.setCode("000");
//            responseDTO.setSuccess(true);
//            responseDTO.setMessage("启动成功");
//        } catch (Exception e) {
//            responseDTO.setCode("500");
//            responseDTO.setSuccess(false);
//            responseDTO.setMessage("启动失败");
//        }
//        return responseDTO;
//    }
//
//}
